<template>
    <div class="box">
        <h1>入学成绩</h1>
        <div class="tent">
            <div>
                <label>学号：<input type="text" v-model="stu_id" /></label><br />
                <label>姓名：<input type="text" v-model="stu_name" /></label><br />
                <label>语文：<input type="text" v-model="chinese" /></label><br />
                <label>数学：<input type="text" v-model="math" /></label><br />
                <label>英语：<input type="text" v-model="english" /></label><br />
                <label>理综：<input type="text" v-model="lizong" /></label><br />
                <label>文综：<input type="text" v-model="wenzong" /></label><br>
                <button @click="submit">提交</button>
            </div>
        </div>
    </div>
</template>

<script>
import request from '../../api/request';
export default {
    data() {
        return {
            stu_id: "",
            stu_name: "",
            chinese: 0,
            math: 0,
            english: 0,
            lizong: 0,
            wenzong: 0,
        };
    },
    methods: {
        submit() {
            let params = {
                stu_id: this.stu_id,
                stu_name: this.stu_name,
                chinese: this.chinese,
                math: this.math,
                english: this.english,
                lizong: this.lizong,
                wenzong: this.wenzong,
            }
            request({method:'post', url:'/entry_exam', arg:params, headerType:'form'});
            this.stu_id = '';
            this.stu_name = '';
            this.chinese = 0;
            this.math = 0;
            this.english = 0;
            this.lizong = 0;
            this.wenzong = 0;
        }
    }
}
</script>

<style lang="scss" scoped>
.box {
    display: flex;
    flex-direction: column;
    align-items: center;

    .tent {
        width: 600px;
        height: 500px;
        border: 1px solid black;
        display: flex;
        justify-content: center;
        align-items: center;
        div{
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
    }
}
</style>